<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    if (80 == request.getServerPort())
    {
        basePath = request.getScheme() + "://"
                + request.getServerName() + path + "/";
    }
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", 0);
    response.setHeader("Cache-Control",
            "no-store,no-cache,must-revalidate");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>">
	<% 
		long diffSec = 180; 
	%> 
		<title>题库管理</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<style type="text/css">
			.tdhead{
				width:10px;
			}
		</style>
		
		<script> 
		var timeSec = <%=diffSec%>; 
		
		function DoConverseCallTimer(){ 
		var minute="0"; 
		var second="0"; 
		timeSec = parseInt(timeSec)-1; 
		minute = parseInt(timeSec/60); 
		second = timeSec%60; 
		
		var lab = ""; 
		if(minute=="0"){ 
		lab =+second+"秒"; 
		}else{ 
		lab =minute+"分"+second+"秒"; 
		} 
		document.getElementById("timer").innerHTML = lab; 
		
		if(second == 0&& minute==0){ 
		clearTimeout(window.timer1); 
		alert("时间到!"); 
		
		
		document.exam.submit(); 
		return true; 
		} 
		
		timer1 = window.setTimeout("DoConverseCallTimer()",1000); 
		
		} 
</script> 
	</head>

	<body>
		<div>
			<jsp:include page="./head.jsp"></jsp:include>
			<jsp:include page="./list.jsp"></jsp:include>
			<div class="bodycontent">
			
			<div  style="color:gray;font_size:20px;border:1px;float:right">
				<span>您剩余的时间为:</span>
				<div id="timer"></div>
			</div>
				<form action="./cross.action" method="post" name="exam" id="kaoshi">
					<table width="97%" style="margin-left:10px;">
						<s:iterator id="quest" value="questList" status="statusQuestList">
							<tr>
								<td class="tdhead">
									<label>${statusQuestList.count }.</label>
								</td>
								<td>
									<label><s:property value="#quest.q_des" /></label>
									<input type="hidden" name="u_id" value="<s:property value="#session.user.u_id" />">
									<input type="hidden" name="quest_${statusQuestList.count}_id" value="<s:property value="#quest.q_id" />">
								</td>
							</tr>
							<tr>
								<td>
									<input class="radioleft" type="radio" checked="checked" name="quest_${statusQuestList.count }" value="A">
								</td>
								<td>
									<label>A. <s:property value="#quest.q_result_A" /></label>
								</td>
							</tr>
							<tr>
								<td>
									<input class="radioleft" type="radio" name="quest_${statusQuestList.count }" value="B">
								</td>
								<td>
									<label>B. <s:property value="#quest.q_result_B" /></label>
								</td>
							</tr>
							<tr>
								<td>
									<input class="radioleft" type="radio" name="quest_${statusQuestList.count }" value="C">
								</td>
								<td>
									<label>C. <s:property value="#quest.q_result_C" /></label>
								</td>
							</tr>
							<tr>
								<td>
									<input class="radioleft" type="radio" name="quest_${statusQuestList.count }"  value="D">
								</td>
								<td>
									<label>D. <s:property value="#quest.q_result_D" /></label>
								</td>
							</tr>
							<tr><td colspan="2"><div style="border-bottom: 1px dashed #6C6C6C;"></div></td></tr>
						</s:iterator>
						<tr><td colspan="2" style="text-align: center;"><a onclick="examSubmit();" class="button">交卷</a></td></tr>
					</table>
				</form>
				<br/><br/><br/><br/><br/>
			</div>
		</div>
		
	
	<script> 
		DoConverseCallTimer(); 
	</script> 
	</body>
</html>
